package ai.people.platform.archives.service.impl;

import ai.people.netmon.framework.domain.archives.entity.ArchivesSocialInfo;
import ai.people.platform.archives.mapper.ArchivesSocialInfoMapper;
import ai.people.platform.archives.service.ArchivesSocialInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhenglin
 * @since 2022-03-30
 */
@Service
public class ArchivesSocialInfoServiceImpl extends ServiceImpl<ArchivesSocialInfoMapper, ArchivesSocialInfo> implements ArchivesSocialInfoService {

    /**
     * 通过档案基本信息ID查询社交媒体信息
     *
     * @param baseInfoId 基础信息id
     * @return {@link ArchivesSocialInfo}
     */
    @Override
    public ArchivesSocialInfo selectByBaseInfoId(Long baseInfoId) {
        LambdaQueryWrapper<ArchivesSocialInfo> socialWrapper = Wrappers.lambdaQuery();
        socialWrapper.eq(ArchivesSocialInfo::getBaseInfoId, baseInfoId);
        return this.getOne(socialWrapper);
    }
}
